﻿{extend name="layout/main-block" /}
{block name="sub-wrapper"}
    <!--内容容器-->
    <section id="sub-wrapper" class="full-screen page-4g">
        <!--数据展示容器-->
        <div id="sub-content">
            <div id="sub-header">
                <div class="sub-title">
                    <h3><i class="fa fa-puzzle-piece"></i>设备--4G流量管理</h3>
                </div>
                <div class="sub-tools">
                    <div id="searchTool">
                        <form class="form-inline">
                            <input size="30" class="form-control" id="phname" placeholder="请输入设备SN进行检索" />
                            <a class="btn btn-primary" id="searchname"><i class="fa fa-search"></i>搜索</a>
                            <a class="btn btn-info" id="delSearch"><i class="fa fa-search"></i>清空搜索</a>
                        </form>
                    </div>
                </div>
            </div>

            <div class="table-responsive data-table">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th class="text-center" width="34px">
                            <input type="checkbox" class="checkboxes" id="selectAll" />
                        </th>
                        <th>ID</th>
                        <th>设备SN</th>
                        <th>设备名称</th>
                        <th>关联账户</th>
                        <th>设备组</th>
                        <th>IMEI</th>
                        <th>ICCID</th>
                        <!--<th>套餐总量</th>
                        <th>已用流量</th>
                        <th>剩余流量</th>-->
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="traffic" id="v" empty="$empty" }
                    <tr>
                        <td class="text-center">
                            <input type="checkbox" class="checkboxes" name="checkbox[]"/>
                        </td>
                        <td>{$v.id}</td>
                        <td>{$v.sn}</td>
                        <td>{$v.name}</td>
                        <td>{$v.username}</td>
                        <td>{$v.dgname}</td>
                        <td>{$v.imei}</td>
                        <td>{$v.iccid}</td>
                        <!--<td>4090MB</td>
                        <td>3078MB</td>
                        <td>1012MB</td>-->
                        <td>
                            <ul class="record-tool">
                                <li><a class="btn btn-info btn-sm viewRecord" data-name="{$v.id}">查看</a></li>
                                <!--<li><a class="btn btn-primary btn-sm recharge" data-name="{$v.id}">充值</a></li>-->
                            </ul>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="2">
                            <ul class="record-tool">
                                <li><a class="btn btn-success btn-sm" id="addRecord"><i class="fa fa-plus"></i>
                                    增加</a></li>
                                <li><a class="btn btn-danger btn-sm" id="batchDel"><i class="fa fa-minus"></i>
                                    删除</a></li>
                            </ul>
                        </td>
                        <td colspan="2" class="">
                            {$page}
                            <!--<ul class="pagination">
                                <li>
                                    <a href="#" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li class="active"><a href="#">1</a></li>
                                <li><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li><a href="#">5</a></li>
                                <li><a href="#">...</a></li>
                                <li><a href="#">999</a></li>
                                <li>
                                    <a href="#" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </ul>-->
                        </td>
                        <td colspan="2" class="text-center">
                            <div class="table-summary">
                                <div class="input-group">
                                    <div class="input-group-addon">到第</div>
                                    <input type="text" class="form-control" id="goto" placeholder="" style="width:40px;">
                                    <div class="input-group-addon">页</div>
                                    <span class="input-group-btn">
                                                <a class="btn btn-primary" data-currentPage="{$currentPage}" data-lastPage="{$lastPage}" id="gotoPage"><i class="fa fa-arrow-right"></i>确定</a>
                                            </span>
                                </div>
                            </div>
                        </td>
                        <td colspan="3" class="text-center">
                            共<span id="total-record" class="text-success fa-2x"> {$count} </span>条记录
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </section>
{/block}

{block name="viewRecord"}

<!--编辑工具-->
<div id="viewRecord" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">ID:<span id="recordId"></span></h4>
            </div>
            <div class="modal-body">
                <div class="col-xs-12">
                    <form class="form-horizontal" name="editForm">
                        <div class="form-group">
                            <label for="sn_id">设备SN</label>
                            <select name="sn_id" id="sn_id" class="form-control">
                                {volist name="sn" id="s" empty="$empty" }
                                <option value="{$s.id}">{$s.sn}--{$s.imei}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="name">设备名称</label>
                            <input type="text" class="form-control" name="name" id="name" >
                        </div>
                        <div class="form-group">
                            <label for="user_id">关联账户</label>
                            <select name="user_id" id="user_id" class="form-control">
                                {volist name="account" id="a" empty="$empty" }
                                <option value="{$a.id}">{$a.username}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="device_group_id">设备组</label>
                            <select name="device_group_id" id="device_group_id" class="form-control">
                                {volist name="dgroup" id="g" empty="$empty" }
                                <option value="{$g.id}">{$g.name}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="iccid__">ICCID</label>
                            <input type="text" class="form-control" name="iccid__" id="iccid__" >
                        </div>
                    </form>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="modal-footer">
                <a class="btn btn-warning" data-dismiss="modal"><i class="fa fa-times"></i>关闭</a>
            </div>
        </div>
    </div>
</div>
<!--编辑工具-->

{/block}
{/block}